#pragma once
#ifndef __TOKENISER__INCLUDED__HH__
#define __TOKENISER__INCLUDED__HH__

#include <string>
#include "LitString.h"
#include "LitExceptions.h"

namespace Lit
{
	class LIT_API Tokeniser
	{
	protected:
		StringVector vec;
	public:
		Tokeniser( );
		Tokeniser( const String &str, const String &delim = " " );
		Tokeniser( const Tokeniser& rk );
		~Tokeniser( );

		String join( const String &link = " " ) const;
		Tokeniser& operator=( const Tokeniser& rk );
		Tokeniser& operator+=( const Tokeniser& rk );
		Tokeniser operator+( const Tokeniser& rk ) const;
		
		Tokeniser& eat( size_t num );
		Tokeniser eat( size_t num ) const;

		String argAt( size_t id );
		String nextArg();
		bool hasMimimum(size_t num_args_required ) const;
		bool hasMoreArgs(size_t from = 0) const;
		
		String rest( size_t from_arg = 0 ) const;

		size_t count() const;
		bool empty() const;
	};
};

#endif